package com.mav.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Slf4j

//@Aspect
@Component
public class MyAspect {
    @Pointcut("execution(* com.mav.service.iml.*.*(..))")
    private void pt(){}
    @Before("pt()")
    public void before(){
        log.info("before...");
    }
    @Around("pt()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        log.info("around...");
        Object proceed = pjp.proceed();
        log.info("around...");
        return proceed;
    };
    @After("pt()")
    public void after(){
        log.info("after...");
    }
    @AfterReturning("pt()")
    public void afterReturning(){
        log.info("afterReturning...");
    }
    @AfterThrowing("pt()")
    public void afterThrowing(){
        log.info("afterThrowing...");
    }
}
